package com.bubblegumproject.ogo.action;

import com.bubblegumproject.ogo.component.Container;

/**
 * @author Azubuko Obele (buko.obele@gmail.com)
 */
public abstract class AbstractFlow implements Flow {

    /**
     * XXX: This is another hack due to the ill-thought-out Conversations API. Let's get rid of it. A Flow should
     * always be considered finished after it has handled an Action.
     * 
     * Note that finished is true by default. This is a bit counterintuitive but it's a time-saving convience: those
     * Flow objects that want to be conversations they must explicitly call 'setFinished(false)' at the end of each
     * ActionHandler method. Otherwise a Flow will automatically be terminated after a method runs. This is a bit of
     * a smell.
     */
    protected boolean finished = true;

    protected Context context;

    protected Container container;

    protected Flow parent;

    public boolean isFinished() {
        return finished;
    }

    public void setFinished(boolean finished) {
        this.finished = finished;
    }

    public Context getContext() {
        return context;
    }

    public void setContext(Context context) {
        this.context = context;
    }

    public Container getContainer() {
        return container;
    }

    public void setContainer(Container container) {
        this.container = container;
    }

    public Flow getParent() {
        return parent;
    }
}


